﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    //在DeliveryRobot中添加一个代表连续工作时长的字段hours。
    class DeliveryRobot:Robot
    {
        private int hours;
        public int Hours 
        {
            get { return this.hours; }
            set { this.hours = value; }
        }
        public DeliveryRobot(string name, int hours) : base(name)
        {
            this.hours = hours;
        }
public override void Working()
        {
            Console.WriteLine("{0}工作了{1}小时",this.name,this.hours);
        }
    }
}
